#include <iostream>
using namespace std;
#include <list>

void printList(const list<int> l)
{
    for (list<int>::const_iterator it = l.begin(); it != l.end(); ++it)
    {
        cout << (*it) << " ";
    }
    cout << endl;
}

bool myComp(int v1,int v2){
rand();
return v1>v2;
}



void test01()
{
    list<int> l1;
    for (int i = 0; i < 10; ++i)
    {
        l1.push_back(i);
    }

l1.push_back(1);
    printList(l1);
    l1.remove(1);    // 删除所有1
    printList(l1);
        for (int i = 10; i >1; --i)
    {
        l1.push_back(i);
    }
    l1.sort(myComp);
    printList(l1);
}

int main()
{
    test01();
}
